package gui;

import java.awt.Color;
import java.awt.Font;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.JButton;
import javax.swing.JTextField;
import java.awt.event.ActionListener;

/**
 * 
 * @author chkr1_000 Initiates AddUser class
 */

// NIELS
public class AddUser extends JPanel {

	private JLabel lblAdmin;
	private JLabel lblThebank;
	private JLabel lblCopyright;
	private JLabel lblCprnumber;
	private JLabel lblFirstname;
	private JLabel lblLastname;
	private JTextField txtCpr;
	private JTextField txtFirstname;
	private JTextField txtLastname;
	private JButton btnAdduser;
	private JButton btnBack;
	Screen screen;
	private JTextField txtNewPassword;
	private JLabel lblPassword;

	/**
	 * Creates the layout for AddUser
	 * 
	 */
	public AddUser() {
		setLayout(null);
		setSize(Screen.SIZE);
		setBackground(Screen.COLOR);

		lblAdmin = new JLabel(".:Admin:.");
		lblAdmin.setForeground(Color.WHITE);
		lblAdmin.setFont(new Font("Helvetica", Font.BOLD, 20));
		lblAdmin.setBounds(281, 50, 88, 21);
		add(lblAdmin);

		lblCopyright = new JLabel("\u00A9 Copyright - All rights reserved");
		lblCopyright.setForeground(Color.WHITE);
		lblCopyright.setFont(new Font("Lucida Grande", Font.PLAIN, 13));
		lblCopyright.setBounds(414, 600, 208, 16);
		add(lblCopyright);

		Icon logo = new ImageIcon(getClass().getResource("190-bank.png"));

		lblThebank = new JLabel("TheBank", logo, SwingConstants.LEFT);
		lblThebank.setForeground(Color.WHITE);
		lblThebank.setFont(new Font("Helvetica", Font.BOLD, 16));
		lblThebank.setBounds(30, 25, 99, 22);
		add(lblThebank);

		lblCprnumber = new JLabel("Cpr-Number:");
		lblCprnumber.setForeground(Color.WHITE);
		lblCprnumber.setBounds(154, 205, 88, 16);
		add(lblCprnumber);

		lblFirstname = new JLabel("Firstname:");
		lblFirstname.setForeground(new Color(255, 255, 255));
		lblFirstname.setBounds(169, 251, 61, 16);
		add(lblFirstname);

		lblLastname = new JLabel("Lastname:");
		lblLastname.setForeground(Color.WHITE);
		lblLastname.setBounds(169, 304, 63, 16);
		add(lblLastname);

		txtCpr = new JTextField("");
		txtCpr.setBounds(261, 199, 151, 28);
		add(txtCpr);
		txtCpr.setColumns(10);

		txtFirstname = new JTextField("");
		txtFirstname.setBounds(261, 245, 151, 28);
		add(txtFirstname);
		txtFirstname.setColumns(10);

		txtLastname = new JTextField("");
		txtLastname.setBounds(261, 298, 151, 28);
		add(txtLastname);
		txtLastname.setColumns(10);

		btnAdduser = new JButton("Add User");
		btnAdduser.setBounds(261, 408, 151, 29);
		add(btnAdduser);

		btnBack = new JButton("Back");
		btnBack.setBounds(261, 469, 151, 28);
		add(btnBack);

		txtNewPassword = new JTextField("");
		txtNewPassword.setBounds(261, 348, 151, 28);
		add(txtNewPassword);
		txtNewPassword.setColumns(10);

		lblPassword = new JLabel("Password:");
		lblPassword.setForeground(Color.WHITE);
		lblPassword.setBounds(167, 354, 63, 16);
		add(lblPassword);

	}

	/**
	 * 
	 * @param addActionListener
	 *            (1)
	 */
	public void addActionListener(ActionListener l) {
		btnBack.addActionListener(l);
		btnAdduser.addActionListener(l);

	}

	/**
	 * 
	 * @return btnBack
	 */
	public JButton getBtnBack() {
		return btnBack;
	}

	/**
	 * 
	 * @param btnBack
	 */
	public void setBtnBack(JButton btnBack) {
		this.btnBack = btnBack;

	}

	/**
	 * 
	 * @return txtCpr
	 */
	public JTextField getTxtCpr() {
		return txtCpr;
	}

	/**
	 * 
	 * @param txtCpr
	 */
	public void setTxtCpr(JTextField txtCpr) {
		this.txtCpr = txtCpr;
	}

	/**
	 * 
	 * @return txtFirstname
	 */
	public JTextField getTxtFirstname() {
		return txtFirstname;
	}

	/**
	 * 
	 * @return txtNewPassword
	 */
	public JTextField getTxtNewPassword() {
		return txtNewPassword;
	}

	/**
	 * 
	 * @param txtNewPassword
	 */
	public void setTxtNewPassword(JTextField txtNewPassword) {
		this.txtNewPassword = txtNewPassword;

	}

	/**
	 * 
	 * @param txtFirstname
	 */
	public void setTxtFirstname(JTextField txtFirstname) {
		this.txtFirstname = txtFirstname;
	}

	/**
	 * 
	 * @return txtLastname
	 */
	public JTextField getTxtLastname() {
		return txtLastname;
	}

	/**
	 * 
	 * @param txtLastname
	 */
	public void setTxtLastname(JTextField txtLastname) {
		this.txtLastname = txtLastname;
	}

	/**
	 * 
	 * @return btnAdduser
	 */
	public JButton getBtnAddUser() {
		return btnAdduser;
	}

	/**
	 * 
	 * @param btnAddUser
	 */
	public void setBtnAddUser(JButton btnAddUser) {
		this.btnAdduser = btnAddUser;
	}

	/**
	 * 
	 * @return screen
	 */
	public Screen getScreen() {
		return screen;
	}

	/**
	 * 
	 * @param screen
	 */
	public void setScreen(Screen screen) {
		this.screen = screen;
	}
}
